package com.google.appengine.api.memcache;

import java.util.Collection;
import java.util.Map;
import java.util.Set;
import lombok.Data;

/**
 *
 * @author Secondary User
 */
public interface MemcacheService
{

	public Long increment(Object key, int i);

	public Long increment(Object key, int i, Long initialValue);

	public void setErrorHandler(ErrorHandler handler);

	public <T> Map<T, IdentifiableValue> getIdentifiables(Set<T> keys);

	public void putAll(Map<?, Object> keysAndValues);

	public <T> Set<T> putIfUntouched(Map<T, CasValues> keysAndCasValues);

	public <T> Map<T, Object> getAll(Collection<T> keys);

	public <T> Set<T> deleteAll(Collection<T> keys);

	public void put(Object key, Object value);
	
	public Object get(Object key);

	@Data
	public static class CasValues
	{

		private final IdentifiableValue iv;
		private final Object nextToStore;
		private final Expiration expiration;
	}

	@Data
	public static class IdentifiableValue
	{

		private final long versionId;
		private final Object value;
	}
}
